package org.jaaksi.androidforflutterdemo.config;

import libcore.config.LibConfig;

/**
 * 创建时间：2017年07月20日16:28 <br>
 * 作者：jaaksi <br>
 * 描述：环境配置
 */

public class UriConfig {

  public static final String HTTP_HEAD = "http://";
  public static final String HTTPS_HEAD = "http://";

  private static String sDomain;

  public interface Env {

    // 线上环境
    String SERVER_RELEASE = "www.wanandroid.com/";
  }

  public static boolean isRelease() {
    return !LibConfig.isDebug();
  }

  public static String getBaseUrl() {
    return getDomain();
  }

  public static String getDomain() {
    if (sDomain == null) {
      if (isRelease()) {
        sDomain = HTTPS_HEAD + Env.SERVER_RELEASE;
      } else {
        sDomain = HTTPS_HEAD + Env.SERVER_RELEASE;
        //sDomain = HTTP_HEAD + Env.SERVER_DEV;
      }
    }
    return sDomain;
  }
}
